/**
 * Copyright (c) 2021-2025  libbylg@126.com
 * str is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *          http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR
 * FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */
#include "testing.hpp"

#include "str.hpp"

TEST(test_str, is_xdigit) {
    ASSERT_EQ(str::is_xdigit("0123456789ABCDEF"), true);
    ASSERT_EQ(str::is_xdigit("ABCDEF"), true);
    ASSERT_EQ(str::is_xdigit("123DEF"), true);

    ASSERT_EQ(str::is_xdigit("0123456789abcdefABCDEF"), true);
    ASSERT_EQ(str::is_xdigit("abcdefABCDEF"), true);
    ASSERT_EQ(str::is_xdigit("123deF"), true);

    ASSERT_EQ(str::is_xdigit("ABCDEFGHIJ"), false);
    ASSERT_EQ(str::is_xdigit("abcDEFghij"), false);
    ASSERT_EQ(str::is_xdigit("123GHI"), false);
    ASSERT_EQ(str::is_xdigit(""), false);
    ASSERT_EQ(str::is_xdigit("123 "), false);
    ASSERT_EQ(str::is_xdigit("  123"), false);
}
